package com.java.base;

public class Poem {
	public static void main(String[] args){
		String str="剑外忽传收蓟北初闻涕泪满衣裳却看妻子愁何在漫卷诗书喜欲狂白日放歌须纵酒青春作伴好还乡即从巴峡穿巫峡便下襄阳向洛阳";
		char[][] poem=new char[8][7];
		int k=0;
		for(int i=0;i<poem.length;i++){
			for(int j=0;j<poem[i].length;j++){
				poem[i][j]=str.charAt(k);
				k++;
			}
		}
		for(int i=0;i<poem.length;i++){
			for(int j=0;j<poem[i].length;j++){
				System.out.print(poem[i][j]);
			}
			System.out.println();
		}
		System.out.println("\n\n下面以古诗的形式输出：\n");
		for(int i=0;i<poem[0].length;i++){
			for(int j=0;j<poem.length;j++){
				System.out.print(poem[poem[0].length-j][i]);
			}
			System.out.println();
		}
	}

}
